/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 77);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {

// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
  ? window : typeof self != 'undefined' && self.Math == Math ? self
  // eslint-disable-next-line no-new-func
  : Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef


/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {

// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(7)(function () {
  return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});


/***/ }),
/* 2 */
/***/ (function(module, exports) {

var core = module.exports = { version: '2.6.11' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef


/***/ }),
/* 3 */
/***/ (function(module, exports) {

var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
  return hasOwnProperty.call(it, key);
};


/***/ }),
/* 4 */
/***/ (function(module, exports) {

module.exports = function (it) {
  return typeof it === 'object' ? it !== null : typeof it === 'function';
};


/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {

// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(25);
var defined = __webpack_require__(13);
module.exports = function (it) {
  return IObject(defined(it));
};


/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {

var anObject = __webpack_require__(10);
var IE8_DOM_DEFINE = __webpack_require__(29);
var toPrimitive = __webpack_require__(20);
var dP = Object.defineProperty;

exports.f = __webpack_require__(1) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  anObject(O);
  P = toPrimitive(P, true);
  anObject(Attributes);
  if (IE8_DOM_DEFINE) try {
    return dP(O, P, Attributes);
  } catch (e) { /* empty */ }
  if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  if ('value' in Attributes) O[P] = Attributes.value;
  return O;
};


/***/ }),
/* 7 */
/***/ (function(module, exports) {

module.exports = function (exec) {
  try {
    return !!exec();
  } catch (e) {
    return true;
  }
};


/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {

var dP = __webpack_require__(6);
var createDesc = __webpack_require__(11);
module.exports = __webpack_require__(1) ? function (object, key, value) {
  return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
  object[key] = value;
  return object;
};


/***/ }),
/* 9 */,
/* 10 */
/***/ (function(module, exports, __webpack_require__) {

var isObject = __webpack_require__(4);
module.exports = function (it) {
  if (!isObject(it)) throw TypeError(it + ' is not an object!');
  return it;
};


/***/ }),
/* 11 */
/***/ (function(module, exports) {

module.exports = function (bitmap, value) {
  return {
    enumerable: !(bitmap & 1),
    configurable: !(bitmap & 2),
    writable: !(bitmap & 4),
    value: value
  };
};


/***/ }),
/* 12 */,
/* 13 */
/***/ (function(module, exports) {

// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
  if (it == undefined) throw TypeError("Can't call method on  " + it);
  return it;
};


/***/ }),
/* 14 */
/***/ (function(module, exports) {

// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = function (it) {
  return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};


/***/ }),
/* 15 */
/***/ (function(module, exports) {

module.exports = true;


/***/ }),
/* 16 */
/***/ (function(module, exports) {

var id = 0;
var px = Math.random();
module.exports = function (key) {
  return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};


/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(31);
var enumBugKeys = __webpack_require__(23);

module.exports = Object.keys || function keys(O) {
  return $keys(O, enumBugKeys);
};


/***/ }),
/* 18 */
/***/ (function(module, exports) {

exports.f = {}.propertyIsEnumerable;


/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {

var global = __webpack_require__(0);
var core = __webpack_require__(2);
var ctx = __webpack_require__(33);
var hide = __webpack_require__(8);
var has = __webpack_require__(3);
var PROTOTYPE = 'prototype';

var $export = function (type, name, source) {
  var IS_FORCED = type & $export.F;
  var IS_GLOBAL = type & $export.G;
  var IS_STATIC = type & $export.S;
  var IS_PROTO = type & $export.P;
  var IS_BIND = type & $export.B;
  var IS_WRAP = type & $export.W;
  var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  var expProto = exports[PROTOTYPE];
  var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
  var key, own, out;
  if (IS_GLOBAL) source = name;
  for (key in source) {
    // contains in native
    own = !IS_FORCED && target && target[key] !== undefined;
    if (own && has(exports, key)) continue;
    // export native or passed
    out = own ? target[key] : source[key];
    // prevent global pollution for namespaces
    exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
    // bind timers to global for call from export context
    : IS_BIND && own ? ctx(out, global)
    // wrap global constructors for prevent change them in library
    : IS_WRAP && target[key] == out ? (function (C) {
      var F = function (a, b, c) {
        if (this instanceof C) {
          switch (arguments.length) {
            case 0: return new C();
            case 1: return new C(a);
            case 2: return new C(a, b);
          } return new C(a, b, c);
        } return C.apply(this, arguments);
      };
      F[PROTOTYPE] = C[PROTOTYPE];
      return F;
    // make static versions for prototype methods
    })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
    // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
    if (IS_PROTO) {
      (exports.virtual || (exports.virtual = {}))[key] = out;
      // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
      if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
    }
  }
};
// type bitmap
$export.F = 1;   // forced
$export.G = 2;   // global
$export.S = 4;   // static
$export.P = 8;   // proto
$export.B = 16;  // bind
$export.W = 32;  // wrap
$export.U = 64;  // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;


/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {

// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__(4);
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
  if (!isObject(it)) return it;
  var fn, val;
  if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  throw TypeError("Can't convert object to primitive value");
};


/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {

var shared = __webpack_require__(22)('keys');
var uid = __webpack_require__(16);
module.exports = function (key) {
  return shared[key] || (shared[key] = uid(key));
};


/***/ }),
/* 22 */
/***/ (function(module, exports, __webpack_require__) {

var core = __webpack_require__(2);
var global = __webpack_require__(0);
var SHARED = '__core-js_shared__';
var store = global[SHARED] || (global[SHARED] = {});

(module.exports = function (key, value) {
  return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
  version: core.version,
  mode: __webpack_require__(15) ? 'pure' : 'global',
  copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
});


/***/ }),
/* 23 */
/***/ (function(module, exports) {

// IE 8- don't enum bug keys
module.exports = (
  'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');


/***/ }),
/* 24 */
/***/ (function(module, exports, __webpack_require__) {

// 7.1.13 ToObject(argument)
var defined = __webpack_require__(13);
module.exports = function (it) {
  return Object(defined(it));
};


/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {

// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__(26);
// eslint-disable-next-line no-prototype-builtins
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  return cof(it) == 'String' ? it.split('') : Object(it);
};


/***/ }),
/* 26 */
/***/ (function(module, exports) {

var toString = {}.toString;

module.exports = function (it) {
  return toString.call(it).slice(8, -1);
};


/***/ }),
/* 27 */
/***/ (function(module, exports) {

exports.f = Object.getOwnPropertySymbols;


/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = { "default": __webpack_require__(43), __esModule: true };

/***/ }),
/* 29 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = !__webpack_require__(1) && !__webpack_require__(7)(function () {
  return Object.defineProperty(__webpack_require__(30)('div'), 'a', { get: function () { return 7; } }).a != 7;
});


/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {

var isObject = __webpack_require__(4);
var document = __webpack_require__(0).document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
  return is ? document.createElement(it) : {};
};


/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {

var has = __webpack_require__(3);
var toIObject = __webpack_require__(5);
var arrayIndexOf = __webpack_require__(36)(false);
var IE_PROTO = __webpack_require__(21)('IE_PROTO');

module.exports = function (object, names) {
  var O = toIObject(object);
  var i = 0;
  var result = [];
  var key;
  for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  // Don't enum bug & hidden keys
  while (names.length > i) if (has(O, key = names[i++])) {
    ~arrayIndexOf(result, key) || result.push(key);
  }
  return result;
};


/***/ }),
/* 32 */,
/* 33 */
/***/ (function(module, exports, __webpack_require__) {

// optional / simple context binding
var aFunction = __webpack_require__(35);
module.exports = function (fn, that, length) {
  aFunction(fn);
  if (that === undefined) return fn;
  switch (length) {
    case 1: return function (a) {
      return fn.call(that, a);
    };
    case 2: return function (a, b) {
      return fn.call(that, a, b);
    };
    case 3: return function (a, b, c) {
      return fn.call(that, a, b, c);
    };
  }
  return function (/* ...args */) {
    return fn.apply(that, arguments);
  };
};


/***/ }),
/* 34 */
/***/ (function(module, exports, __webpack_require__) {

// 7.1.15 ToLength
var toInteger = __webpack_require__(14);
var min = Math.min;
module.exports = function (it) {
  return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};


/***/ }),
/* 35 */
/***/ (function(module, exports) {

module.exports = function (it) {
  if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  return it;
};


/***/ }),
/* 36 */
/***/ (function(module, exports, __webpack_require__) {

// false -> Array#indexOf
// true  -> Array#includes
var toIObject = __webpack_require__(5);
var toLength = __webpack_require__(34);
var toAbsoluteIndex = __webpack_require__(37);
module.exports = function (IS_INCLUDES) {
  return function ($this, el, fromIndex) {
    var O = toIObject($this);
    var length = toLength(O.length);
    var index = toAbsoluteIndex(fromIndex, length);
    var value;
    // Array#includes uses SameValueZero equality algorithm
    // eslint-disable-next-line no-self-compare
    if (IS_INCLUDES && el != el) while (length > index) {
      value = O[index++];
      // eslint-disable-next-line no-self-compare
      if (value != value) return true;
    // Array#indexOf ignores holes, Array#includes - not
    } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
      if (O[index] === el) return IS_INCLUDES || index || 0;
    } return !IS_INCLUDES && -1;
  };
};


/***/ }),
/* 37 */
/***/ (function(module, exports, __webpack_require__) {

var toInteger = __webpack_require__(14);
var max = Math.max;
var min = Math.min;
module.exports = function (index, length) {
  index = toInteger(index);
  return index < 0 ? max(index + length, 0) : min(index, length);
};


/***/ }),
/* 38 */,
/* 39 */,
/* 40 */,
/* 41 */,
/* 42 */,
/* 43 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(44);
module.exports = __webpack_require__(2).Object.assign;


/***/ }),
/* 44 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.3.1 Object.assign(target, source)
var $export = __webpack_require__(19);

$export($export.S + $export.F, 'Object', { assign: __webpack_require__(45) });


/***/ }),
/* 45 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// 19.1.2.1 Object.assign(target, source, ...)
var DESCRIPTORS = __webpack_require__(1);
var getKeys = __webpack_require__(17);
var gOPS = __webpack_require__(27);
var pIE = __webpack_require__(18);
var toObject = __webpack_require__(24);
var IObject = __webpack_require__(25);
var $assign = Object.assign;

// should work with symbols and should have deterministic property order (V8 bug)
module.exports = !$assign || __webpack_require__(7)(function () {
  var A = {};
  var B = {};
  // eslint-disable-next-line no-undef
  var S = Symbol();
  var K = 'abcdefghijklmnopqrst';
  A[S] = 7;
  K.split('').forEach(function (k) { B[k] = k; });
  return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  var T = toObject(target);
  var aLen = arguments.length;
  var index = 1;
  var getSymbols = gOPS.f;
  var isEnum = pIE.f;
  while (aLen > index) {
    var S = IObject(arguments[index++]);
    var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
    var length = keys.length;
    var j = 0;
    var key;
    while (length > j) {
      key = keys[j++];
      if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
    }
  } return T;
} : $assign;


/***/ }),
/* 46 */,
/* 47 */,
/* 48 */,
/* 49 */,
/* 50 */,
/* 51 */,
/* 52 */,
/* 53 */,
/* 54 */,
/* 55 */,
/* 56 */,
/* 57 */,
/* 58 */,
/* 59 */,
/* 60 */,
/* 61 */,
/* 62 */,
/* 63 */,
/* 64 */,
/* 65 */,
/* 66 */,
/* 67 */,
/* 68 */,
/* 69 */,
/* 70 */,
/* 71 */,
/* 72 */,
/* 73 */,
/* 74 */,
/* 75 */,
/* 76 */,
/* 77 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var babel_runtime_core_js_object_assign__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28);
/* harmony import */ var babel_runtime_core_js_object_assign__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_core_js_object_assign__WEBPACK_IMPORTED_MODULE_0__);

(function (pluginLoad, $, window, document, undefined) {

    // 无限滚动
    function RollSlider(opt) {
        this.init(opt);
    }
    RollSlider.prototype = {
        // 构造函数指向自身
        constructor: RollSlider,
        // 获取DOM
        _$: function _$(str) {
            return typeof str === 'string' ? document.querySelector(str) : str;
        },
        // 覆盖默认参数
        _extend: function _extend(def, opt) {
            for (var key in def) {
                if (opt.hasOwnProperty(key)) {
                    def[key] = opt[key];
                }
            }
            return def;
        },
        // 初始化
        init: function init(opt) {
            opt = opt || {};
            // 默认参数
            var defaultOpt = {
                el: '' // 目标元素
                , auto: true // 是否自动运行
                , speed: 1 // 速度，值越小越慢。
            };

            this.opt = this._extend(defaultOpt, opt);
            this.opt.el = this._$(this.opt.el);
            this.opt.sliderEl = this.opt.el.firstElementChild;
            this.opt.isEnough = false; // 默认数量不足

            if (!this.opt.el) {
                console.warn('未绑定元素');
                return;
            }

            this.isLoaded();

            var _this = this;
            // 暂停
            this.opt.el.onmouseenter = function () {
                _this.opt.isEnough && _this.stop();
            };
            // 运行
            this.opt.el.onmouseleave = function () {
                _this.opt.isEnough && _this.run();
            };
        },
        // 定时循环，直到加载完DOM后再运行
        isLoaded: function isLoaded() {
            var _this = this;
            var hasDOM = setInterval(function () {
                if (_this.opt.sliderEl.firstElementChild) {

                    var childNodes = _this.childNodes(_this.opt.sliderEl.childNodes),
                        childNodesLen = childNodes.length,
                        lastNode = childNodes[childNodesLen - 1];
                    _this.opt.width = _this.opt.el.getBoundingClientRect().width || 0; // 容器宽度
                    _this.opt.pos_left = _this.opt.el.getBoundingClientRect().left || 0; // 容器左侧位置
                    _this.opt.pos_right = _this.opt.el.getBoundingClientRect().right || 0; // 容器右侧位置
                    _this.opt.offset_right = lastNode.getBoundingClientRect().right || 0; // 容器内最后一个子元素右侧偏移量
                    _this.opt.pos_reset = window.getComputedStyle(lastNode).getPropertyValue('margin-right') || '0px'; //子元素margin-right偏移量，用来reset值

                    _this.opt.isEnough = _this.isEnoughDOM();
                    if (_this.opt.isEnough) {
                        _this.opt.auto && _this.run();
                        _this.opt.auto && _this.cloneDOM();
                    }
                    clearInterval(hasDOM);
                }
            }, 50);
        },
        // 容器元素数量不够时，不运行
        isEnoughDOM: function isEnoughDOM() {
            var childNodes = this.childNodes(this.opt.sliderEl.childNodes),
                childNodesLen = childNodes.length,
                lastNode = childNodes[childNodesLen - 1];
            if (lastNode.getBoundingClientRect().right - this.opt.pos_left <= this.opt.width) {
                return false;
            }
            return true;
        },
        // 处理childNodes
        childNodes: function childNodes(nodes) {
            var filterNodes = Array.prototype.slice.call(nodes).filter(function (node) {
                return node.nodeType === 1; // html元素
            });
            return filterNodes || [];
        },
        // 克隆元素，运行一次
        cloneDOM: function cloneDOM() {
            var _this = this,
                childNodes = _this.opt.sliderEl.childNodes;
            if (_this.opt.isClone) return;

            Array.prototype.slice.call(childNodes).forEach(function (node) {
                var cloneNode = node.cloneNode(true);
                _this.opt.sliderEl.appendChild(cloneNode);
            });
            _this.opt.isClone = true;
        },
        // 容器复原
        reset: function reset() {
            var el = this.opt.sliderEl,
                left = parseFloat(el.style.left) || 0;
            if (left + (this.opt.offset_right - this.opt.pos_left) <= 0) {
                el.style.left = this.opt.pos_reset; // 这里根据item的margin-right来取值
            }
        },
        // 运行
        run: function run() {

            this.reset(); //

            var el = this.opt.sliderEl,
                left = parseFloat(el.style.left) || 0;
            var _this = this;

            el.style.left = left - this.opt.speed + 'px';
            this.opt.requestID = requestAnimationFrame(this.run.bind(_this));
        },
        // 暂停
        stop: function stop() {
            var _this = this;
            cancelAnimationFrame(_this.opt.requestID);
        }
    };

    // 三级联动 下拉菜单联动（依赖jquery.selectmenu.js）
    function ChainPicker(opt) {
        this.init(opt);
    }
    ChainPicker.prototype = {
        // 构造函数指向自身
        constructor: ChainPicker,
        // 初始化
        init: function init(opt) {
            var _this2 = this;

            opt = opt || {};
            this.opt = {};

            if ($('.picker_container').length) {
                console.warn('已创建picker');
                return false;
            }
            // 3：三级联动  2：二级联动  1：一级联动
            this.opt.level = opt.level || 3;
            if (this.opt.level > 3 || this.opt.level < 1) {
                console.warn('level取值在1-3');
                return false;
            }

            // 赋值数据
            this.opt.first = opt.data.first;
            this.opt.second = opt.data.second;
            this.opt.third = opt.data.third;

            // msg
            this.opt.msg = opt.msg;

            // 设置各级宽度
            opt.style = opt.style || {};
            this.opt.style = {
                first: opt.style.first || 200,
                second: opt.style.second || 200,
                third: opt.style.third || 200
            };

            // 显示字段
            this.opt.showField = opt.showField;
            this.opt.keyField = opt.keyField;
            this.opt.chainField = opt.chainField;

            // 是否多选（有且只能是三级）
            this.opt.multiple = opt.multiple || {};

            // 点击元素
            this.opt.elem = opt.elem;

            // 取值目标元素
            this.opt.targetElem = opt.targetElem || opt.elem;

            this.opt.msgTempt = typeof opt.msgTempt === 'function' && opt.msgTempt() || window.alert;

            // 创建容器
            this.createElem(function () {
                _this2.opt.$first = $('.pickerFirst');
                _this2.opt.$second = $('.pickerSecond');
                _this2.opt.$third = $('.pickerThird');
                _this2.loadFirst();
            });

            var _this = this;

            // body绑定click事件
            document.body.addEventListener('click', handleClick, false);

            // 处理click事件
            function handleClick(e) {
                var $tar = $(e.target);
                if (e.target === _this.opt.elem || $tar.hasClass('picker_container')) {
                    return null;
                }
                // 确认picker数据
                if ($tar.hasClass('pickerConfirm')) {
                    _this.confirm();
                }
                // 移除picker DOM元素
                if ($tar.hasClass('pickerCancel') || !$tar.parents('.picker_container').length) {
                    _this.removeElem();
                    document.body.removeEventListener('click', handleClick, false);
                }
            }
        },
        // 确认选择
        confirm: function confirm() {
            var showMsg = this.opt.msgTempt || window.alert,
                level = +this.opt.level;
            var first = this.opt.$first.selectMenuValues(),
                second = this.opt.$second.selectMenuValues(),
                third = this.opt.$third.selectMenuValues();
            // 多选长度限制
            if (this.opt.multiple.on && this.opt.multiple.length < third.length) {
                showMsg('\u591A\u9009\u5185\u5BB9\u6700\u591A\u9009\u62E9' + this.opt.multiple.length + '\u9879', { icon: 5 });
                return false;
            }
            // 分级，判断值
            if (!first.length) {
                showMsg('请选择' + this.opt.msg.first, { icon: 5 });
                return false;
            } else {
                if (level === 2) {
                    if (!second.length && this.opt.$second.find('.sm_message_box').length < 1) {
                        showMsg('请选择' + this.opt.msg.second, { icon: 5 });
                        return false;
                    }
                }
                if (level === 3) {
                    if (second.length) {
                        if (!third.length && this.opt.$third.find('.sm_message_box').length < 1) {
                            showMsg('请选择' + this.opt.msg.third, { icon: 5 });
                            return false;
                        }
                    } else {
                        if (this.opt.$second.find('.sm_message_box').length < 1) {
                            showMsg('请选择' + this.opt.msg.second, { icon: 5 });
                            return false;
                        }
                    }
                }
            }
            this.transTargetElem(first, second, third);
        },
        // 转换target元素，当传入 input、textarea、select时赋值value，否则赋值html
        transTargetElem: function transTargetElem() {
            var _this = this,
                targetElem = _this.opt.targetElem[0] || _this.opt.targetElem,
                result = '';

            for (var _len = arguments.length, params = Array(_len), _key = 0; _key < _len; _key++) {
                params[_key] = arguments[_key];
            }

            params.forEach(function (item, index) {
                if (index === 2 && _this.opt.multiple.on && item.length > 1) {
                    var itemStr = '';
                    item.forEach(function (item1) {
                        itemStr += item1[_this.opt.showField] + ',';
                    });
                    itemStr = itemStr.slice(0, -1);
                    result += itemStr;
                } else {
                    result += item[0] && item[0][_this.opt.showField] + "-" || '';
                }
            });
            result = result.slice(0, -1);
            if (targetElem.nodeName === 'INPUT' || targetElem.nodeName === 'SELECT' || targetElem.nodeName === 'TEXTAREA') {
                targetElem.value = result;
            } else {
                targetElem.innerHTML = result;
            }
            targetElem.setAttribute('title', result);
            $('.pickerCancel').click();
        },
        // 移除picker容器
        removeElem: function removeElem() {
            $('.picker_container').remove();
        },
        // 创建picker容器
        createElem: function createElem(callback) {
            var elem = this.opt.elem,
                x = elem.getBoundingClientRect().left || 0,
                y = elem.getBoundingClientRect().top + $(elem).height() + 5 + $(window).scrollTop() || 0;
            var level = +this.opt.level,
                domLevel = '';
            switch (level) {
                case 1:
                    domLevel += '<div class="pickerFirst" style="width: ' + this.opt.style.first + 'px"></div>';
                    break;
                case 2:
                    domLevel += '<div class="pickerFirst" style="width: ' + this.opt.style.first + 'px"></div>\n                                 <div class="pickerSecond"></div>';
                    break;
                case 3:
                    domLevel += '<div class="pickerFirst" style="width: ' + this.opt.style.first + 'px"></div>\n                                 <div class="pickerSecond"></div>\n                                 <div class="pickerThird"></div>';
                    break;
            }
            var dom = '<div class="picker_container" style="left: ' + x + 'px; top: ' + y + 'px;">\n                            ' + domLevel + '\n                            <div class="picker_container_btn clearfix">\n                                <button class="layui-btn pickerConfirm" type="button">\u786E\u8BA4</button>\n                                <button class="layui-btn layui-btn-primary pickerCancel" type="button">\u53D6\u6D88</button>\n                            </div>\n                        </div>';
            $('body').append(dom);
            callback();
        },
        // 一级
        loadFirst: function loadFirst() {
            var _this = this;
            this.opt.$first.selectMenu({
                showField: _this.opt.showField,
                keyField: _this.opt.keyField,
                title: _this.opt.msg.first || '一级',
                search: false,
                embed: true,
                orderBy: false,
                data: _this.opt.first,
                eSelect: function eSelect() {
                    _this.opt.$second.selectMenuClear();
                    _this.opt.$third.selectMenuClear();
                    _this.loadSecond();
                }
            });
        },
        // 二级
        loadSecond: function loadSecond() {
            var _this = this,
                $first = _this.opt.$first;
            this.opt.$second.width(this.opt.style.second);
            this.opt.$second.selectMenu({
                showField: _this.opt.showField,
                keyField: _this.opt.keyField,
                title: _this.opt.msg.second || '二级',
                search: false,
                embed: true,
                orderBy: false,
                data: function data() {
                    var arr = [],
                        values = $first.selectMenuValues();
                    if (values && values.length) {
                        $.each(_this.opt.second, function (i, row) {
                            if (row[_this.opt.chainField] === values[0][_this.opt.keyField]) {
                                arr.push(row);
                            }
                        });
                    }

                    arr.length ? _this.opt.$second.removeClass('hidden') : _this.opt.$second.addClass('hidden');

                    return arr;
                },
                eSelect: function eSelect() {
                    _this.opt.$third.selectMenuClear();
                    _this.loadThird();
                }
            });
        },
        // 三级
        loadThird: function loadThird() {
            var _this = this,
                $second = _this.opt.$second;
            this.opt.$third.width(this.opt.style.third);
            this.opt.$third.selectMenu({
                showField: _this.opt.showField,
                keyField: _this.opt.keyField,
                title: _this.opt.msg.third || '三级',
                multiple: _this.opt.multiple.on || false,
                search: false,
                embed: true,
                orderBy: false,
                data: function data() {
                    var arr = [],
                        values = $second.selectMenuValues();
                    if (values && values.length) {
                        $.each(_this.opt.third, function (i, row) {
                            if (row[_this.opt.chainField] === values[0][_this.opt.keyField]) {
                                arr.push(row);
                            }
                        });
                    }

                    arr.length ? _this.opt.$third.removeClass('hidden') : _this.opt.$third.addClass('hidden');

                    return arr;
                },
                eSelect: function eSelect(res) {
                    if (_this.opt.multiple.on && res.length > _this.opt.multiple.length) {
                        _this.opt.msgTempt('\u591A\u9009\u5185\u5BB9\u6700\u591A\u9009\u62E9' + _this.opt.multiple.length + '\u9879', { icon: 5 });
                    }
                }
            });
        }
    };

    // 插件集合
    var plugin = {
        rollSlider: function rollSlider(config) {
            return new RollSlider(config);
        },
        chainPicker: function chainPicker(config) {
            return new ChainPicker(config);
        }
    };

    window.pluginLoad = babel_runtime_core_js_object_assign__WEBPACK_IMPORTED_MODULE_0___default()(pluginLoad, plugin);
})(window.pluginLoad || {}, jQuery, window, document);

/***/ })
/******/ ]);